IOError after 3 tries Yahoo! did not return a 200 for url

by: akreuz, 8 years ago


Hi! I'm new to Python, therefore apologies if my question is very basic...I'm trying to import very simple stock data from yahoo (or google) but seem to run into the following error message:

IOError: after 3 tries, Yahoo! did not return a 200 for url
'http://ichart.finance.yahoo.com/table.csv?s=F&a=0&b=1&c=2016&d=0&e=27&f=2016&g=d&ignore=.csv'

interesting enough, if I copy/past the http:// link into a browser it lets me open the csv file in excel without issues.

Here's the simple code I'm using:

[import pandas as pd
import pandas.io.data as web
import datetime
import numpy as np
import matplotlib.pyplot as plt

start = datetime.datetime(2016, 1, 1)
end = datetime.datetime(2016, 1, 27)

f=web.DataReader("F", 'yahoo', start, end)

print(f)]

Some forums suggest that the yahoo link needed to be adjusted in the pandas io package (to finance.yahoo) but that seemed to have been fixed already in the data file.

Your help is greatly appreciated!




You must be logged in to post. Please login or register an account.



So I just copy and pasted the code you gave me, it runs just fine.

Are you possibly on some sort of proxy server, or maybe using an outdated version of Python or Pandas?

-Harrison 8 years ago

You must be logged in to post. Please login or register an account.


Thanks for the quick response Harrison. I don't think the Python/Panda versions are an issue but it could be a proxy server problem as I'm trying to do some analysis at work. I will try from a different machine tonight. If it is a proxy server issue, do you think there's a workaround? Since the csv link which comes with the error message sees to work when copied to a browser? Thanks again for your help!

-akreuz 8 years ago

You must be logged in to post. Please login or register an account.